package com.cchr.acms.constant;

public enum CaseStatus implements IKeyValue{
	
	NEW("New", "0"), 
	INPROCESS("In Process", "1"), 
	SEEKING_ATTORNEY("Seeking Attorney", "2"),
	WORKING_WITH_ATTORNEY("Working with Attorney", "3"),
	ONGOING_ACTION("Ongoing Action", "4"),
	COMPLETED("Completed", "5"),
	INVALID("Invalid", "6");
	
	private String key;
	private String value;
	
	private CaseStatus(String key, String value)
	{
		this.key = key;
		this.value = value;
	}

	public String getValue() 
	{
		return value;
	}

	public String getkey() 
	{
		return key;
	}

	public static IKeyValue[] getList() 
	{
		return CaseStatus.values();
	}
	
	public static String getValueByKey(String key) 
	{
		IKeyValue[] list = getList();
		for(IKeyValue keyValue : list)
		{
			if(keyValue.getkey().equals(key))
			{
				return keyValue.getValue();
			}
		}
		return "";
	}
	
	public static String getKeyByValue(String value) 
	{
		IKeyValue[] list = getList();
		for(IKeyValue keyValue : list)
		{
			if(keyValue.getValue().equals(value))
			{
				return keyValue.getkey();
			}
		}
		return "";
	}
}
